'''
Created on Sep 15, 2011

@author: QA
'''
from BeautifulSoup import BeautifulSoup
import re

def getTitle(src):
    pass

def getPrettify(src):
    soup = BeautifulSoup(''.join(src))
    return soup.prettify()

def test(src, homeUrl):
    soup = BeautifulSoup(''.join(src))
    soup = soup.findAll(attrs={'class' : re.compile("text$")})
    for s in soup :
        print homeUrl + s.h2.a['href']



class ExtractInfo :
    def zhidaoGet(self, src, homeUrl):
        dictt = {}
        soup = BeautifulSoup(''.join(src))
        soup = soup.findAll(attrs={'class' : 'f14 fbold'})
        for s in soup :
            dictt[s.string] = homeUrl + s['href']
        return dictt